diff options
| author | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2024-04-07 09:58:46 +0100 |
|---|---|---|
| committer | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2024-04-07 09:58:46 +0100 |
| commit | c9ffd961639c2d0d32da491f3c696d7b921bfb2c (patch) | |
| tree | d0c97b95e69219c1ececcf7ae0579787e5bfd40e /src/pages/[locale] | |
| parent | e0bb1d646c00412c0f147df292720bb95adee8a2 (diff) | |
Contact form page
Diffstat (limited to 'src/pages/[locale]')
| -rw-r--r-- | src/pages/[locale]/contact.astro | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/pages/[locale]/contact.astro b/src/pages/[locale]/contact.astro new file mode 100644 index 0000000..653396b --- /dev/null +++ b/src/pages/[locale]/contact.astro @@ -0,0 +1,35 @@ +--- +import Page from '$layouts/Page.astro'; +import localeStaticPaths from '$lib/localeStaticPaths'; +import translate from '$i18n/translate'; +import tContact from '$i18n/translations/pages/contact'; +import type Locale from '$types/Locale'; + +export async function getStaticPaths() { + return localeStaticPaths; +} + +const locale = Astro.params.locale as Locale; +const t = translate(locale); +--- + +<Page title={(t(tContact, { key: 'title' }))}> + <h1>{ t(tContact, { key: 'title' }) }</h1> + + <h2>{ t(tContact, { key: 'submit-enquiry-online' }) }</h2> + <form method="post" action="/api/contact-form"> + <label for="name">{ t(tContact, { key: 'name-label' }) }</label> + <input id="name" type="text" name="name" required /> + + <label for="email">{ t(tContact, { key: 'email-label' }) }</label> + <input id="email" type="email" name="email" required /> + + <label for="subject">{ t(tContact, { key: 'subject-label' }) }</label> + <input id="subject" type="text" name="subject" required /> + + <label for="message">{ t(tContact, { key: 'message-body-label' }) }</label> + <textarea id="message" name="message" rows="3" cols="40" /> + + <button type="submit">{ t(tContact, { key: 'submit-button' }) }</button> + </form> +</Page> |
